package com.sxbang.friday.controller;


import com.sxbang.friday.base.result.Results;
import com.sxbang.friday.model.SysRole;
import com.sxbang.friday.service.SysRoleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author :ali
 * @date :2020/1/27 19:09
 * @description：
 * @modified By:
 * @version: 1.0.0
 */
@Controller
@RequestMapping(value = "/role")
@Slf4j
public class RoleController {
    @Autowired
    private SysRoleService sysRoleService;

    /**
     * 获取所有role
     * @return Results<SysUser>
     */
    @ResponseBody
    @GetMapping("/all")
    public Results<SysRole> getAllRole() {
        log.info("RoleController.getAllRole()");
        return sysRoleService.getAllRoles();
    }

}
